klass = GTK_CELL_RENDERER_GET_CLASS (cell);
klass->get_aligned_area (cell, widget, flags, cell_area, aligned_area);
+
+ g_assert (aligned_area->x >= cell_area->x && aligned_area->x < cell_area->x + cell_area->width);
+ g_assert (aligned_area->y >= cell_area->y && aligned_area->y < cell_area->y + cell_area->height);
+ g_assert ((aligned_area->x - cell_area->x) + aligned_area->width <= cell_area->width);
+ g_assert ((aligned_area->y - cell_area->y) + aligned_area->height <= cell_area->height);
}
pango_layout_get_pixel_extents (layout, NULL, &rect);
- if (height)
- *height = ypad * 2 + rect.height;
-
- if (width)
- *width = xpad * 2 + rect.x + rect.width;
-
if (cell_area)
{
gfloat xalign, yalign;
gtk_cell_renderer_get_alignment (cell, &xalign, &yalign);
+ rect.height = MIN (rect.height, cell_area->height - 2 * ypad);
+ rect.width = MIN (rect.width, cell_area->width - (2 * xpad) - rect.x);
+
if (x_offset)
{
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
if (y_offset) *y_offset = 0;
}
+ if (height)
+ *height = ypad * 2 + rect.height;
+
+ if (width)
+ *width = xpad * 2 + rect.x + rect.width;
+
g_object_unref (layout);
}